package com.sharding.transaction.demo.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sharding.transaction.demo.consumer.BussinessProviderService;
import com.sharding.transaction.demo.entity.Orders;
import com.sharding.transaction.demo.vo.OrdersVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class BussinessController {

    @Autowired
    private BussinessProviderService bussinessProviderService;

    @RequestMapping("/take")
    public Object takeOrder(Long userId, Long goodsId, Integer store){
        return bussinessProviderService.takeOrder(userId, goodsId, store);
    }

    @RequestMapping("/orders")
    public IPage<Orders> orders(Integer pageSize, Integer pageNumber, OrdersVo orders){
        return bussinessProviderService.orders(pageSize, pageNumber, orders);
    }

}
